package cn.lavender.crypto.remark;

import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.digest.Digester;

/**
 * <p>
 * 摘要算法：SHA-256
 * </p>
 *
 * @author: zhu.chen
 * @date: 2021/3/20
 * @version: v1.0.0
 */
public class Sha256Crypto {

    private static final Digester DIGESTER = SecureUtil.sha256();

    /**
     * sha256的摘要计算
     * @param data
     * @return
     */
    public static String sha256(String data) {
        return DIGESTER.digestHex(data);
    }

    public static void main(String[] args) {
        System.out.println(Sha256Crypto.sha256("小明"));
    }

}
